<!doctype html>
<html lang="en">
<head>
    <title>Document</title>
    <include file="../simpleboot3/public@function"/>
    <script src="__TMPL__/public/assets/js/jquery-1.10.2.min.js" language="JavaScript"></script>
    <script src="__STATIC__/js/layer/layer.js"></script>
    <style>
        input{margin:10px 80px 10px 10px;}
	.input2{
		#display:block;
	}
    </style>
	  <style type="text/css">
	body,input{ font-family:"微软雅黑";}
        input{margin:10px 10px 10px 10px;
    border-radius: 5px;
    height: 40px;
    width: 260px;
    border: solid 1px #57b99f;}
	select{margin:10px 10px 10px 10px;    border-radius: 5px;
    height: 40px;
    width: 260px;
    border: solid 1px #57b99f;}
	
    </style>
    <meta charset="UTF-8">
    <title>会员充值查询</title>
</head>
<body style="background: rgba(28, 109, 42, 0.19)">
    <h4>会员信息</h4>
    <input type="hidden" id="phone" value=""/>
    <input type="hidden" id="type" value="">
    <div id="content">
    </div>
	<div style=" width:870px; height:100%; margin:0 auto; color:#04730A;">
    <input type="button" value="关闭" style="height: 45px;width: 155px; background:#57b99f; color:#fff; font-size:16px; cursor:pointer" id="btn_cancel"/>
    <input type="button" value="充值" style="height: 45px;width: 155px; background:#57b99f; color:#fff; font-size:16px; cursor:pointer" onclick='chongzhi()' />
	</div>
</body>
</html>
<script>
   /*
   * 获取父页面的mobile 并进行ajax传值
   * */
   var phone=parent.$('#mobile').val();
   var type=parent.$("input[name='account']:checked ").val();
   $('#phone').val(phone);
   $('#type').val(type);
   $.post('{:url("member/recharge")}',{phone:phone,type:type},function (date) {
      var state=date.msg.state;
      var data=date.msg.con;
       var index = parent.layer.getFrameIndex(window.name); //获取当前窗体索引
      if(state==1)
      {
          var src='<div>卡面卡号: <input type="text" name="card_id" value="'+
              data.card_id+
              '" class="input2" readonly ></div>'+
              '<div>会员姓名: <input type="text" name="uname"  value="'+
              data.uname+
              '" id="inp" class="input2" readonly /> </div>'+
              '<div>手&nbsp;机&nbsp;&nbsp;号: <input type="text" id="phone" name="mobile" value="'+
              data.mobile+
              '" class="input2" readonly > </div>'+
              '<div>账户余额:<input type="text" name="balance"  id="money" value="'+
              data.balance+
              '"  class="input2" readonly id="2"> </div>'+
              '<div>账户积分:<input type="text" name="balance"  id="integral" value="'+
              data.integral+
              '"  class="input2" readonly id="2"> </div>'
          $('#content').html(src);
      }else{
          alert(data);
          parent.layer.close(index); //执行关闭
      }

   },'json');
   function chongzhi(){
       layer.open({
           type: 2,
           title: '会员充值',
           shadeClose: true,
           shade: false,
           maxmin: true, //开启最大化最小化按钮
           area: ['893px', '500px'],
           content: '../member/chongzhi'//视图路径
       });
   }
   $('#btn_cancel').click(function(){
       var index = parent.layer.getFrameIndex(window.name); //获取当前窗体索引
       parent.layer.close(index);
   })
</script>